import axios from 'axios'

export interface DishSpecVO {
  id: number
  specName: string
  priceDiff: number
}

export interface DishVO {
  id: number
  name: string
  price: number
  stock: number
  imageUrl?: string
  specs: DishSpecVO[]
}

export interface CategoryVO {
  id: number
  name: string
  dishes: DishVO[]
}

export const fetchMenu = () =>
  axios.get<CategoryVO[]>('/api/dish/menu').then(res => res.data)